<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>时间Block-缩影信息</title>
    <!--加载 缩影 CSS-->
    <link rel="stylesheet" href="public/css/block/time.css">
</head>
<body>
    <div class="container">
        <!--天气 Block-->
        <div class="Block">
            <div class="time">
                <div class="time_title">
                    x <span style="font-size:.7em;">天后 <span style="color: #7d7d83;">开始</span></span>
                </div>
                <div class="time_left">
                    load
                </div>
                <div class="time_right">
                    ...
                </div>
                <div class="clearfix"></div>
            </div>
        </div>
    </div>
    <script type="text/javascript" defer>
 	    $(document).ready(function(){
 	    	var time = json.soryin.blockId.time.timeStart;	//获取时间
 	    	var time_left = SoryinDate(new Date(parseInt(time)).getDay());	//获取星期
 	    	var time_right = SoryinDates(time);	//获取月日
 	    	
 	    	var endTime=new Date().getTime();  //获取当前时间  
 	    	var days=Math.floor((time-endTime)/(24*3600*1000));  //计算出相差天数 
 	    	if(days > 0)var dayString = days+' <span style="font-size:.7em;">天后 <span style="color: #7d7d83;">开始</span></span>';
 	    	if(days == 0)var dayString = '现在 <span style="font-size:.7em;">正在 <span style="color: #7d7d83;">进行</span></span>';
 	    	if(days < 0)var dayString = -days+' <span style="font-size:.7em;">天前 <span style="color: #7d7d83;">结束</span></span>';
 	    	 
 	    	$(".time_title").html(dayString);	//显示到html上
 	    	$(".time_left").html(time_left);	//显示到html上
 	    	$(".time_right").html(time_right);	//显示到html上
 	    	
 	    	//返回星期
 	    	function SoryinDate(date){
 	    		if(date ==1) return "星期一";
 	    		if(date ==2) return "星期二";
 	    		if(date ==3) return "星期三";
 	    		if(date ==4) return "星期四";
 	    		if(date ==5) return "星期五";
 	    		if(date ==6) return "星期六";
 	    		if(date ==7) return "星期日";
 	    	}
 	    	//返回  5月20
 	    	function SoryinDates(time){
			var date = new Date(parseInt(time));
 	    		return date.getMonth()+"月"+date.getDate();
 	    	}
 	    	
	    }); 
    </script>
</body>
</html>
